home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 92 / 092.d81 / switch 'em (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  8KB  |  242 lines

  1. 3 poke56,152:clr:poke787,0
  2. 5 dv=peek(186):ifdv<8thendv=8
  3. 10 poke53281,0:poke53280,0:print"[147]"
  4. 12 gosub60000
  5. 15 rem goto30
  6. 20 sys57812"sw font",dv,0:poke780,0:poke781,0:poke782,200:sys65493
  7. 25 sys57812"copymem.o",dv,0:poke780,0:poke781,60:poke782,3:sys65493
  8. 26 poke53280,6:poke53281,6:bb=6:sys828,52224,51200,8
  9. 27 dv=peek(186):ifdv<8thendv=8
  10. 28 qp=256
  11. 30 poke56576,4:poke53272,2:poke648,192:poke53265,27
  12. 40 print"[154][147]":dimsn(46),sl(24)
  13. 45 w$="@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
  14. 50 forx=1to46:readsn(x):next
  15. 60 data27,7,23,11,30,13,29,14,14,27,13,7,27,11,30,7,13,23,30,13,23,14,11,11,14
  16. 70 data23,13,30,23,13,7,30,11,27,7,13,27,14,14,29,13,30,11,23,7,27
  17. 80 forx=1to24:readsl(x):next
  18. 90 data27,7,23,11,11,27,7,7,7,23,11,11,11,11,23,7,7,7,27,11,11,23,7,27
  19. 100 forx=1to6:readmn$(x):next
  20. 110 data"1. level 1 puzzle","2. level 2 puzzle","3. solution to level 1"
  21. 120 data"4. solution to level 2","5. instructions","6. quit"
  22. 130 bk$="[171][179][177][178][157][157][157][157][176][174][172][187][157][157][157][157][173][189][188][190][145][145]"
  23. 140 cl$(0)="[158]":cl$(1)="[144]":cl$(2)=""
  24. 150 ifpeek(787)=13thensys828,152*qp,49152,1000:sys828,156*qp,55296,1000:goto180
  25. 152 print"[147][150]":gosub2000
  26. 155 xx=7:yy=3:ww=24:dd=10:gosub3000
  27. 157 xx=5:yy=18:ww=28:dd=1:gosub3000
  28. 158 poke214,19:print:printtab(7)"t [158]- tile    b [158]- background"
  29. 160 poke214,5:print:printtab(12)"_[195] switch 'em [195]^"
  30. 165 printtab(13)"[155]by brian boese"
  31. 170 print"[158]":fori=1to6:printtab(9)mn$(i):next
  32. 175 sys828,49152,152*qp,1000:sys828,55296,156*qp,1000:poke787,13
  33. 180 gm=1
  34. 220 poke214,7+gm:print:print""tab(9)mn$(gm):gosub1670
  35. 230 ifjs=15ora$=chr$(13)then310
  36. 240 ifa$>="1"anda$<="6"thengm=val(a$):goto310
  37. 250 ifjs=29thena$=""
  38. 260 ifjs=30thena$="[145]"
  39. 270 print"":poke214,7+gm:print:printtab(9)"[158]"mn$(gm)
  40. 280 ifa$=""thengm=gm+1:ifgm=7thengm=1
  41. 290 ifa$="[145]"thengm=gm-1:ifgm=0thengm=6
  42. 300 goto220
  43. 310 ifgm=6then9000
  44. 320 ifgm=5thengosub1470:goto150
  45. 330 ongmgosub980,350,980,350
  46. 340 goto150
  47. 350 print"[147][150]":gosub2000
  48. 352 xx=1:yy=16:ww=12:dd=4:gosub3000
  49. 353 print"[145][145][145][145][145][145]switch 'em"
  50. 354 print"[155]level 2"
  51. 355 print"i[158]-up  m[158]-down"
  52. 356 print"j[158]-lft k[158]-rght"
  53. 357 xx=26:yy=2:ww=9:dd=2:gosub3000
  54. 360 print""tab(9)"[144][166][163][163][163][163][163][163][163][163][163][163][163][163][220]"
  55. 365 forx=1to5:printtab(9)"[144][165]            [167][129]@":next
  56. 370 printtab(9)"[144][165]             [163][163][163][163][163][163][163][220]"
  57. 380 forx=1to3:printtab(9)"[144][165]                    [167][129]@":next
  58. 390 printtab(9)"[144]\[164][164][164][164][164][164][164]             [167][129]@"
  59. 395 printtab(10)"@@@@@@@[145]"
  60. 400 forx=1to5:printtab(17)"[144][165]            [167][129]@":next
  61. 402 printtab(17)"[144]\[164][164][164][164][164][164][164][164][164][164][164][164][219][129]@"
  62. 403 printtab(18)"[129]@@@@@@@@@@@@@@"
  63. 405 n=0:b$=""
  64. 410 print""tab(27)"[155]soln:  46":printtab(27)"[155]moves: 0"
  65. 420 forx=0to2:fory=0to2:gd(x,y)=1:gd(x+2,y+2)=2:next:next:gd(2,2)=0:bk=12:mv=0
  66. 430 gosub940
  67. 440 ifgm=2then490
  68. 450 form=1to46:js=sn(m):gosub710:fortt=1to100:next:next
  69. 460 xx=22:yy=19:ww=11:dd=1:gosub3000
  70. 465 print"[145][145][145]"tab(23)"press a key"
  71. 470 gosub1670
  72. 480 return
  73. 490 gosub560:iftthen490
  74. 495 ifqthenq=0:goto550
  75. 500 xx=23:yy=18:ww=13:dd=2:gosub3000:print"[145][145][145][145][145]"
  76. 505 ifb$="y"then550
  77. 510 ifn=16thenprinttab(25)"you got it!":goto530
  78. 520 printtab(24)"you're stuck!"
  79. 530 printtab(25)"press a key"
  80. 540 gosub1670
  81. 550 return
  82. 560 gosub1670:ifjs=15then560
  83. 570 ifa$="q"thenq=1:return
  84. 630 ifa$="i"thenjs=30
  85. 640 ifa$="k"thenjs=23
  86. 650 ifa$="m"thenjs=29
  87. 660 ifa$="j"thenjs=27
  88. 670 ifa$="[201]"thenjs=14
  89. 680 ifa$="[203]"thenjs=7
  90. 690 ifa$="[205]"thenjs=13
  91. 700 ifa$="[202]"thenjs=11
  92. 710 db=1:if(jsand16)=0thendb=2
  93. 720 if(jsand1)=0thenfm=bk+5*db:pc=2
  94. 730 if(jsand2)=0thenfm=bk-5*db:pc=1
  95. 740 if(jsand4)=0thenfm=bk+1*db:pc=2
  96. 750 if(jsand8)=0thenfm=bk-1*db:pc=1
  97. 760 xt=int(bk/5):yt=bk-5*xt:xf=int(fm/5):yf=fm-5*xf
  98. 770 iffm<0orfm>24then560
  99. 780 ifgd(xf,yf)=0orgd(xf,yf)<>pcthen560
  100. 790 mv=mv+1:gd(xt,yt)=gd(xf,yf):gd(xf,yf)=0:bk=fm:x=yf:y=xf:gosub960
  101. 800 x=yt:y=xt:gosub960:t=0:ifxf>0thenifgd(xf-1,yf)=1thent=-1
  102. 810 ifxf>1thenifgd(xf-2,yf)=1thent=-1
  103. 820 ifxf<4thenifgd(xf+1,yf)=2thent=-1
  104. 830 ifxf<3thenifgd(xf+2,yf)=2thent=-1
  105. 840 ifyf>0thenifgd(xf,yf-1)=1thent=-1
  106. 850 ifyf>1thenifgd(xf,yf-2)=1thent=-1
  107. 860 ifyf<4thenifgd(xf,yf+1)=2thent=-1
  108. 870 ifyf<3thenifgd(xf,yf+2)=2thent=-1
  109. 880 iftthenreturn
  110. 890 forx=0to2:fory=0to2:ifgd(x,y)=2thenn=n+1
  111. 900 ifgd(x+2,y+2)=1thenn=n+1
  112. 910 next:next
  113. 920 ifgd(2,2)>0thenn=n-1
  114. 930 return
  115. 940 fory=0to2:forx=0to2:gosub960:next:next
  116. 950 fory=2to4:forx=2to4:gosub960:next:next:return
  117. 960 print"";:fora=0tox:print"";:next:fora=0toy:print"";
  118. 970 next:printcl$(gd(y,x))bk$:print""tab(33)mv:return
  119. 980 print"[147][150]":gosub2000:xx=2:yy=1:ww=20:dd=3:gosub3000
  120. 985 print""tab(5)"_[192] switch 'em [192]^"
  121. 987 printtab(7)"[155]l e v e l   1"
  122. 990 gosub4000
  123. 1000 print"[145][145][145][145][145][145][144][171][179][177][178][171][179][177][178][171][179][177][178][171][179][177][178][158][171][179][177][178][171][179][177][178][171][179][177][178][171][179][177][178][171][179][177][178]"
  124. 1010 print"[144][176][174][172][187][176][174][172][187][176][174][172][187][176][174][172][187][158][176][174][172][187][176][174][172][187][176][174][172][187][176][174][172][187][176][174][172][187]"
  125. 1020 print"[144][173][189][188][190][173][189][188][190][173][189][188][190][173][189][188][190][158][173][189][188][190][173][189][188][190][173][189][188][190][173][189][188][190][173][189][188][190]"
  126. 1030 n=0:b$=""
  127. 1035 xx=26:yy=3:ww=9:dd=2:gosub3000
  128. 1040 print"[155]"tab(27)"soln:  24":printtab(27)"[155]moves: 0"
  129. 1045 gosub5000
  130. 1050 forx=0to3:gr(x)=1:gr(x+5)=2:next:gr(4)=0:bk=4:mv=0
  131. 1060 ifgm=1then1110
  132. 1070 form=1to24:js=sl(m):gosub1290:fortt=1to200:next:next
  133. 1080 gosub3000:poke214,19:print:printtab(7)"press any key to continue"
  134. 1090 gosub1670
  135. 1100 return
  136. 1110 gosub1180:iftthen1110
  137. 1120 ifqthenq=0:goto1170
  138. 1125 xx=2:yy=16:ww=34:dd=4:gosub3000:poke214,18:print""
  139. 1130 ifn=8thenprinttab(14)"you got it!":goto1150
  140. 1140 printtab(10)"uh oh, you're stuck"
  141. 1150 printtab(7)"press any key to continue"
  142. 1160 gosub1670
  143. 1170 return
  144. 1180 gosub1670:ifjs=15then1180
  145. 1190 ifa$="q"thenq=1:return
  146. 1250 ifa$="k"thenjs=23
  147. 1260 ifa$="j"thenjs=27
  148. 1270 ifa$="[203]"thenjs=7
  149. 1280 ifa$="[202]"thenjs=11
  150. 1290 db=1:if(jsand16)=0thendb=2
  151. 1300 if(jsand4)=0thenfm=bk+db:pc=2
  152. 1310 if(jsand8)=0thenfm=bk-db:pc=1
  153. 1320 xt=bk:xf=fm
  154. 1330 iffm<0orfm>9then1180
  155. 1340 ifgr(xf)=0orgr(xf)<>pcthen1180
  156. 1350 mv=mv+1:gr(xt)=gr(xf):gr(xf)=0:bk=fm:x=xf:gosub1450
  157. 1360 x=xt:gosub1450:t=0:ifxf>0thenifgr(xf-1)=1thent=-1
  158. 1370 ifxf>1thenifgr(xf-2)=1thent=-1
  159. 1380 ifxf<9thenifgr(xf+1)=2thent=-1
  160. 1390 ifxf<8thenifgr(xf+2)=2thent=-1
  161. 1400 iftthenreturn
  162. 1410 forx=0to3:ifgr(x)=2thenn=n+1
  163. 1420 ifgr(x+5)=1thenn=n+1
  164. 1430 next
  165. 1440 return
  166. 1450 print"[157][157]";:fora=0tox:print"";:next
  167. 1460 printcl$(gr(x))bk$:print""tab(33)mv:return
  168. 1470 print"[147]"tab(5)"_[195] switch 'em instructions [195]^"
  169. 1480 print"[158]the object of this puzzle is to switch"
  170. 1490 print"the positions of the black stones with"
  171. 1500 print"the white stones. black stones may only"
  172. 1510 print"move down or to the right, and white"
  173. 1520 print"stones may only move up or to the left."
  174. 1530 print"stones move one at a time into the"
  175. 1540 print"empty space, which is yellow."
  176. 1550 print"[155]    level 1 puzzle    level 2 puzzle"
  177. 1560 print"                          [144][209][209][209]"
  178. 1570 print"                          [144][209][209][209]"
  179. 1580 print"      [144][209][209][209][209][158][209][209][209][209][209]           [144][209][209][158][209][209][209]"
  180. 1590 print"                            [209][209][209]"
  181. 1600 print"                            [209][209][209]"
  182. 1610 print"[158]controls:  up[158]    - i     [158]or you may"
  183. 1620 print"           down  [158]- m     [158]use a joystick"
  184. 1630 print"           left  [158]- j     [158]plugged into"
  185. 1640 print"           right [158]- k     [158]port 2"
  186. 1650 print"hold shift or the firebutton to jump.